package com.android.webserver.tornado;

public class Configuration
{
	private final int			port							= 8080;
	private final int			startThreads			= 15;
	private final int			maxThreads				= 100;
	private final int			minIdleThreads		= 5;
	private final int			maxIdleThreads		= 10;
	private final int			logLevel					= Logger.DEBUG_PRIO;
	private final String	version						= "0.2.1";
	private final String	versionSignature	= "Tornado/" + version;

	// private final File mimeTypes = new
	// File("/home/nconway/tornado/conf/mime.types");

	/** Parses the specified config file. */
	Configuration()
	{
		;
	}

	/** Returns the local ports the server is running on. */
	public final int getPort()
	{
		return port;
	}

	/**
	 * Returns the priority of messages that are accepted. Any log messages with a
	 * lower priority than this are ignored.
	 */
	public final int getLogLevel()
	{
		return logLevel;
	}

	/**
	 * Returns the server's signature. This is specified by the HTTP standard, and
	 * consists of the name of the software, and the revision, as well as any
	 * additional components.
	 */
	public final String getVersionSig()
	{
		return versionSignature;
	}

	/**
	 * Returns the version number of the server. This is the plain of the server,
	 * without any additional tags or identifiers.
	 */
	public final String getVersion()
	{
		return version;
	}

	/**
	 * Returns the number of <code>ServerThread</code>s spawned at startup.
	 * Obviously, the number of active threads will change throughout the lifetime
	 * of the server.
	 */
	public final int getStartThreads()
	{
		return startThreads;
	}

	/**
	 * Returns the maximum number of <code>ServerThread</code>s that will ever be
	 * running concurrently.
	 */
	public final int getMaxThreads()
	{
		return maxThreads;
	}

	/**
	 * Returns the minimum number of idle threads. If there are fewer idle threads
	 * available than this, new instances of <code>ServerThread</code> will be
	 * spawned by the <code>ThreadManager</code> at a rate of 2 per second until
	 * we reach <code>maxIdleThreads</code>.
	 * 
	 * @see #getMaxIdleThreads()
	 * @see tornado.ThreadManager
	 */
	public final int getMinIdleThreads()
	{
		return minIdleThreads;
	}

	/**
	 * Returns the maximum number of idle threads. If there are more idle threads
	 * than this, they are killed by the <code>ThreadManager</code>.
	 * 
	 * @see #getMinIdleThreads()
	 * @see tornado.ThreadManager
	 */
	public final int getMaxIdleThreads()
	{
		return maxIdleThreads;
	}

	/*
	 * public final File getMimeTypes() { return mimeTypes; }
	 */
}
